package pers.cz.orm.dao.dialect;

import utils.DateUtils;

import java.util.Date;

/**
 * @program: Jef-orm
 * @description: PostgreSql方言
 * @author: Cheng Zhi
 * @create: 2023-09-25 14:55
 **/
public class PostgreSqlDialect extends AbstractDialect{

    @Override
    public String toDbDate(Date date) {
        return "TO_TIMESTAMP('" + DateUtils.format((Date) date, "yyyy-MM-dd HH:mm:ss")+ "','yyyy-mm-dd hh24:mi:ss')";
    }

    @Override
    public String getDriveName() {
        return "org.postgresql.Driver";
    }
}
